# -*- coding: utf-8 -*-

'''
Função factorial
'''
def factorial(n):

    if n <= 0:
        return 1
    else:
        return n * factorial(n - 1)

def factorial_cauda(n):
    def fact(i=n, acc=1):
        if i == 0:
            return acc
        else:
            return fact(i -1, (acc  *i))
    return fact()

x = factorial_cauda(5)
print x
